

var aa = localStorage.getItem("globalsearchcontain")
console.log(aa)

axios({
    url: '/findAllVideoByLikeKeyWords',
    method: 'get',
    params: {
        keyWords: aa,
    }
})
    .then(function (data) {
        console.log(data.data.data.data.allVideo[0].actorList)
        var globaclsearchactorListlength = data.data.data.data.allVideo[0].actorList.length
        var allcontainrighttop = document.getElementById("allcontainrighttop");
        if (globaclsearchactorListlength==0){
            allcontainrighttop.innerHTML="暂无演员信息";
            allcontainrighttop.style.textAlign="center";
            allcontainrighttop.style.color="#666"
        }else{
            var allcontainrighttop = document.getElementById("allcontainrighttop");

            for (let i = 0; i < 1;i++){
                allcontainrighttop.innerHTML += `
                <a href="/actorintroduce?${data.data.data.data.allVideo[0].actorList[i].actorId}"  style="text-decoration:none; ">     
                <div style = "width: 100px;height: 100px; margin-left: 40%;" >
                    <img src='${data.data.data.data.allVideo[0].actorList[i].actorSrc}' style="border-radius: 100%;width: 100%;height: 100%;">
                </div>
                <p style="color: #ff6000;text-align: center;">${ data.data.data.data.allVideo[0].actorList[i].actorName }</p>
                <p style="color: #666;">职业: <span style="color: black;">${ data.data.data.data.allVideo[0].actorList[i].actorOccupation }</span></p>
                <p style="color: #666;">生日: <span style="color: black;">${ data.data.data.data.allVideo[0].actorList[i].actorBirthday }</span></p>
                <p style="color: #666;">地区: <span style="color: black;">香港</span></p>
                <p class="actorintroduction" style="color: #666;">简介: <span style="color: black;">${ data.data.data.data.allVideo[0].actorList[i].actorIntroduction }</span></p>
            </a>

            `
            }



            var actorintroduction = document.getElementsByClassName("actorintroduction");
            console.log(actorintroduction)
            for (let j = 0; j < actorintroduction.length;j++){
                if (actorintroduction[j].innerHTML.length>200){
                   var newactorintroduction =  actorintroduction[j].innerHTML.substring(0, 200) + "...";
                    actorintroduction[j].innerHTML = newactorintroduction
                }else{
                }
            }       
        }
        var globaclsearchallallVideo = data.data.data.data.allVideo
        var globaclsearchallallVideolength = data.data.data.data.allVideo.length
        console.log(globaclsearchallallVideolength)
        // console.log("全局模糊查询成功")
        var allvideocontain = document.getElementById("allvideocontain");

        var searchcontain = document.getElementById("searchcontain");
        var searchallvideo = document.getElementById("searchallvideo");
        searchcontain.innerHTML=aa;
        searchallvideo.innerHTML = data.data.data.data.allVideo.length
        for (let i = 0; i < globaclsearchallallVideolength;i++){
            console.log(data.data.data.data.allVideo[i].videoPath)
            allvideocontain.innerHTML+=
                `<div>`+
                        `<div style="width: 180px;height: 236px;float: left;">`+
            `<img src='${data.data.data.data.allVideo[i].videoPhoto}'  style="width: 100%;height: 100%;">`+
                        `</div>`+
                        `<p style="color: #ff6000;">` + data.data.data.data.allVideo[i].videoName+`</p >`+
                        `<p style="color: #ff6000;display:none;">` + data.data.data.data.allVideo[i].videoId + `</p >` +
                        `<p>`+
            ` <span style="color: #666;">` + "地区:" + `<span style="color: black;">` + data.data.data.data.allVideo[i].regionType + `</span>`+
            ` <span style="color: #666;margin-left: 10%;;">` + "类型:" + `<span style="color: black;">` + data.data.data.data.allVideo[i].videoType + `</span>` +
            ` <span style="color: #666;margin-left: 10%;">` + "资费:" + `<span style="color: black;">` + data.data.data.data.allVideo[i].whetherFree+ `</span>` +
                        `</p>`+
            `<p style="color: #666;">` + "上映时间:" + `<span  style="color: black;">` + data.data.data.data.allVideo[i].videoYear+"年" +`</span>`+`</p>`
            + `<p style="color: #666;">` + "简介:" + `<span  style="color: black;">` + data.data.data.data.allVideo[i].introduction + `</span>` + `</p>`
            + ` <p>` + `<a href="/play?${data.data.data.data.allVideo[i].videoId}">`+` <button class="golookvideo" style="color:white;background: #00be06;border: none;border-radius: 30px;padding: 10px;width: 100px;margin-top: 20px;opacity: 0.8;">`+"立即播放" +` </button>`+`</a>`+`</p>`+
                `</div>`



        }



        

    })
    .catch(function (error) {
        console.log('全局模糊查询失败')
    })




function tele() {
    // 返回一个promise对象
    return new Promise((resolve, reject) => {
        axios({
            url: '/index/MoreTV',
            method: 'get',
        })
            .then((res) => {
                resolve(res.data.data);
            })
            .catch(function (error) {
                reject(error);
            });
    });
}
async function showTele() {
    let a = await tele();
    var trl = document.getElementsByClassName('trl-ul')[0];
    console.log(a)
    for (var i = 0; i < 7; i++) {
        // console.log(a[i].videoId)
        trl.innerHTML += `
        <li class="trl-item">
            <a class="rank-list" href = '/play?${a[i].videoId}'>
                <div class='rank-num'>${i + 1}</div>
                <div class="rank-content">
                    <span class='rush'>${a[i].videoName}</span>
                    <p style="overflow: hidden;white-space:nowrap;text-overflow: ellipsis;font-size:13px;">${a[i].videoBriefly}</p>
                </div>
            </a>

      `
    }
    var rank1 = document.getElementsByClassName('rank-num');
    rank1[0].style.color = '#ff473a';
    rank1[1].style.color = '#f73'
    rank1[2].style.color = '#ffa82e'
}
showTele();









